home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
boost4.arc
/
MANUAL2.400
< prev
next >
Wrap
Text File
|
1988-10-23
|
40KB
|
902 lines
BOOSTERS 4.0
Tools for Turbo Pascal Programmers
Users Guide
Part II
Copyright (C) 1988 George F. Smith & Company
All Rights Reserved
The Boosters library of routines and its documentation are
protected by the Copyright Laws of the United States. They
may not be resold, distributed, or copied without permission
in writing from George F. Smith and Company. The only
exception is the right of the purchaser of Boosters to make an
archival copy of the distribution diskettes as a means of
securing his or her investment.
For information about Boosters, please contact:
George F. Smith & Company
609 Candlewick Lane
Lilburn, GA 30247
(404) 923-6879
-----------------------------------------------------------
MblkHeap Procedure
-----------------------------------------------------------
Purpose Moves a block on a page of heap.
Declaration MblkHeap ( Hpage : HeapBuf;
x1,y1,x2,y2,x3,y3 : Integer );
Remarks MblkHeap moves the block defined by (x1,y1)
and (x2,y2) on Hpage to the location beginning
at (x3,y3). The original block is filled with
blanks and an attribute of 0Eh (intense
yellow on black).
See also CblkHeap
Example Emulate page scrolling by moving text up one
line on Page[1] of the heap.
MblkHeap ( Page[1],1,2,80,25,1,1 );
-----------------------------------------------------------
MoveBg Procedure
-----------------------------------------------------------
Purpose Nondestructively moves a block on the screen.
Declaration MoveBg ( Hpage : HeapBuf;
x1,y1,x2,y2,x3,y3 : Integer );
Remarks When used in a loop, this routine gives the
impression of a box moving over a background
without disturbing the screen. The screen
(without the box) should be saved on Hpage.
The box should then be created on the screen.
MoveBg will:
- copy the box defined by (x1,y1)
and (x2,y2) to the stack
- refresh the screen from Hpage
- copy the box from the stack to the
screen beginning at (x3,y3)
Example Move a box over the screen without erasing
anything.
{--- Load or build a screen first ---}
.
.
.
{--- Save it to the heap ---}
SaveScreen ( Page[1] );
{--- Create a box (or menu) or some kind ---}
Box ( 20,8,40,17,1,14 );
{--- Using animation, move the box ---}
for i := 0 to 15 do begin
MoveBg ( Page[1], 20+1*2, 8,
40+i*2, 17,
22+i*2, 8 );
delay(4);
end;
-----------------------------------------------------------
MoveBlk Procedure
-----------------------------------------------------------
Purpose Moves a block on the screen.
Declaration MoveBlk ( x1,y1,x2,y2,x3,y3 : Integer );
Remarks Saves the block defined by (x1,y1),(x2,y2)
to the stack, fills the original block
location on the screen with blanks and
attribute 0Eh, then copies the block from
the stack to (x3,y3).
See also MoveBlkr, CopyBlk
Example Swap two paragraphs of text on the screen.
Assume paragraphs defined at
(1,5),(72,10) and (1,12),(72,17).
{--- Page[1] is a scratch area ---}
{--- Save the top pp to the heap ---}
Scr2Heap ( Page[1],1,5,72,10,1,1);
{--- Replace the top pp with the
one beneath it ---}
MoveBlk (1,12,72,17,1,5);
{--- Complete the swap ---}
Heap2Scr ( Page[1],1,1,72,6,1,12 );
will perform the swap.
-----------------------------------------------------------
MoveBlkr Procedure
-----------------------------------------------------------
Purpose Moves a block on the screen.
Declaration MoveBlkr ( x1,y1,x2,y2,x3,y3 : Integer;
Att : Byte );
Remarks Saves the block defined by (x1,y1),(x2,y2)
to the stack, fills the original block
location on the screen with blanks and
attribute Att, then copies the block from
the stack to (x3,y3).
See also MoveBlk, CopyBlk
Example See example for MoveBlk.
-----------------------------------------------------------
NsOrbit Procedure
-----------------------------------------------------------
Purpose Orbit a box for a specified time.
Declaration NsOrbit ( x1,y1,x2,y2 : Integer;
Style, Att : Byte;
NumberOfSeconds : Integer );
Remarks Draws a box on the screen, gradually erases
all but two opposing sections of the box,
then orbits the box with those sections for
NumberOfSeconds or until a key is pressed.
The original box is redrawn when the orbiting
is finished.
The box dimensions are given by (x1,y1),
(x2,y2). Style selects the choice of sides
(see Box Procedure), and Att specifies the
video attribute for the sides.
Example Draw a box and orbit it for 1 second.
NsOrbit (25,5,55,12,1,14,1);
-----------------------------------------------------------
OverStr Function
-----------------------------------------------------------
Purpose Overlays one string on another.
Declaration OverStr ( New, Target : String;
N, Len : Integer;
Pad : Char ) : String;
Result Type String
Remarks Returns a string with New overlayed on
Target, beginning at position N of Target,
for length Len. If N > length(Target), or
if Len > length(New), the result is padded
accordingly with Pad.
Example Overlay some strings onto another string.
Target := 'ABCD';
New := '123';
S := OverStr(New,Target,2,2,' ');
{--- assigns 'A12D' to S ---}
S := OverStr(New,Target,6,6,'_');
{--- assigns 'ABCD_123___' to S ---}
-----------------------------------------------------------
PchaHeap Procedure
-----------------------------------------------------------
Purpose Writes an attribute/character to the heap.
Declaration PchaHeap ( Hpage : HeapBuf; AttCh, X, Y :
Integer );
Remarks Writes AttCh at (x,y) on Hpage of the
heap. AttCh is assumed to be an
attribute/character combination for video
memory operations.
See also GchaHeap
Example Copy the attribute/character at (80,35)
of Page 1 to the home position of Page 2.
PchaHeap ( Page[2],
GchaHeap(Page[1],80,25),
1,1);
-----------------------------------------------------------
Pdq Procedure
-----------------------------------------------------------
Purpose Writes a string to video memory without
altering the cursor position.
Declaration Pdq (NSEW : Char; S : String; X,Y : Integer;
Att : Byte );
Remarks Copies S to video memory at (X,Y), with
attribute Att. NSEW determines output
direction:
'N' or 'n' - North (Bottom to Top)
'S' or 's' - South (Top to Bottom)
'E' or 'e' - East (Left to Right)
'W' or 'w' - West (Right to Left)
See also PutStr
Example Write '1 2 3' top-to-bottom, in a single
column.
Pdq ('s','1 2 3',10,5,14 );
{--- Will display:
1
2
3
in column 10, row 5 ---}
-----------------------------------------------------------
PosR Function
-----------------------------------------------------------
Purpose Searches a string in a forward direction.
Declaration PosR ( Needle, HayStack : String;
Start : Integer ) : Integer;
Result Type Integer
Remarks Searches HayStack for Needle beginning
from Start. Returns the starting position
of Needle, or returns zero if Needle is not
found.
See also LastPos, Pos (Turbo Pascal)
Example Find all the 'i's in Mississippi.
Start := 1;
Needle := 'i';
HayStack := 'Mississippi';
WriteLn('i''s are found at:');
repeat
WhereI := PosR(Needle,HayStack,Start);
WriteLn(WhereI);
Start := WhereI + Length(Needle);
until WhereI = 0;
-----------------------------------------------------------
PutHeap Procedure
-----------------------------------------------------------
Purpose Writes a string to a page of heap.
Declaration PutHeap ( Hpage : HeapBuf; HV : Char;
S : String; X,Y : Integer;
Att : Byte );
Remarks Copies S to Hpage with video attribute Att,
beginning at (x,y). HV controls output
direction:
'V' or 'v' - Vertically (Top to Bottom)
any other - Horizontally (Left to Right)
PutHeap is the 'heap' counterpart of PutStr.
Example Center a string at the top of heap page 1.
PutHeap ( Page[1],h,
Center('MASTER MENU FUNCTIONS',
80,' '),
1,1,14 );
-----------------------------------------------------------
PutStr Procedure
-----------------------------------------------------------
Purpose Writes a string to video memory.
Declaration PutStr ( HV : Char; S : String;
X,Y : Integer; Att : Byte );
Remarks Copies S to video memory with video attribute
Att, beginning at (x,y). HV controls output
direction:
'V' or 'v' - Vertically (Top to Bottom)
any other - Horizontally (Left to Right)
PutStr writes S then advances the cursor by
the length of S + 1.
See also Pdq, CtrScr
Example Center a string at the top of the screen.
PutStr ( h,
Center('MASTER MENU FUNCTIONS',
80,' '),
1,1,14 );
-----------------------------------------------------------
RemBlk Procedure
-----------------------------------------------------------
Purpose Clears an area of the screen.
Declaration RemBlk ( x1,y1,x2,y2 : Integer );
Remarks Writes blanks with a video attribute of 14
to the block of video memory defined by
(x1,y1), (x2,y2).
See also RemblkR
Example Clear the interior of a box.
Box ( 20, 5, 60, 15, 1, 14 );
RemBlk ( 21, 6, 59, 14 );
-----------------------------------------------------------
RemBlkR Procedure
-----------------------------------------------------------
Purpose Clears an area of the screen with a specified
attribute.
Declaration RemBlkR ( x1,y1,x2,y2 : Integer; Att : Byte );
Remarks Writes blanks with video attribute Att
to the block of video memory defined by
(x1,y1), (x2,y2).
See also Remblk
Example Clear the interior of a box.
Box ( 20, 5, 60, 15, 1, 30 );
RemBlkR ( 21, 6, 59, 14, 30 );
-----------------------------------------------------------
RestoreScreen Procedure
-----------------------------------------------------------
Purpose Copies a page of heap to the screen.
Declaration RestoreScreen ( Hpage : HeapBuf );
Remarks Copies the contents of Hpage to video
memory.
See also Heap2Scr, SaveScreen, Scr2Heap
Example Restore a menu screen previously saved to
page 3 of the heap.
RestoreScreen ( Page[3] );
-----------------------------------------------------------
Right Function
-----------------------------------------------------------
Purpose Right-justifies a string.
Declaration Right ( S : String; Width : integer;
Pad : Char ) : String;
Result Type String
Remarks Returns S right-justified in a field of
size Width. If Width is greater than the
length of S, Pad characters are added to
the left of S to fill out the result.
See also Left, Center
Example Display a padded dollar figure.
S := '$149.99';
Width := 10;
PutStr ( h, Right(S,Width,'*'),
1, 1, 14 );
{--- Displays '***$149.99' ---}
-----------------------------------------------------------
Rword Function
-----------------------------------------------------------
Purpose Replaces a word with a string.
Declaration Rword ( Original : String; N : Integer;
ReplaceWith : String ) : String;
Result Type String
Remarks Returns a string with ReplaceWith replacing
word N of Original. If Original is null or
N is less than 1, Rword returns a null string.
If N is greater than the number of words in
Original, then Rword returns Original.
See also Space, SubWord, WordN, Words, WordPos, WordInd
Example Modify a string.
Phrase := 'This was the result:';
Phrase := Rword(Phrase,2,'should have been');
{--- Phrase is now
'This should have been the result:'
---}
-----------------------------------------------------------
SaveScreen Procedure
-----------------------------------------------------------
Purpose Copies the screen to a page of heap.
Declaration SaveScreen ( Hpage : HeapBuf );
Remarks Copies the contents of video memory to Hpage.
See also Scr2Heap, Heap2Scr, RestoreScreen
Example Save the current screen to page 3 of the heap.
SaveScreen ( Page[3] );
-----------------------------------------------------------
Scr2Disk Procedure
-----------------------------------------------------------
Purpose Copies the screen to disk file.
Declaration Scr2Disk ( FileDesc : String;
ScreenNum : Integer;
var Ecode : Integer );
Remarks Copies the contents of video memory to the
disk file defined by FileDesc, as screen
number ScreenNum. Ecode indicates the
success of the operation:
0 - successful
3 - path not found
4 - no handle available
5 - access denied
6 - disk full
Scr2Disk attempts to open, write to, and
close FileDesc.
See also Disk2Mem, Fil2Heap
Example Copy the screen to Help.Txt as screen number 2.
Scr2Disk ( 'C:\Help.Txt',2,Ecode );
if Ecode = 0 then
ClrScr
else
SaveProblem;
-----------------------------------------------------------
Scr2Heap Procedure
-----------------------------------------------------------
Purpose Copies an area of the screen to the heap.
Declaration Scr2Heap ( Hpage : HeapBuf;
x1,y1,x2,y2,x3,y3 : Integer );
Remarks Copies the block of video memory given by
(x1,y1), (x2,y2) to Hpage beginning at
(x3,y3).
See also SaveScreen, Heap2Scr, RestoreScreen
Example Copy an information box to Page 1.
Scr2Heap ( Page[1], 20, 2, 60, 12, 1, 1 );
-----------------------------------------------------------
SetAtt Procedure
-----------------------------------------------------------
Purpose Sets the video attributes of a portion of
the screen.
Declaration SetAtt ( x1,y1,x2,y2 : Integer;
Att : Byte );
Remarks Sets the attributes of the area given by
(x1,y1), (x2,y2) to Att.
See also ChgAtt, HeapAtt
Example Paint the screen blue.
SetAtt ( 1,1,80,25,30 );
-----------------------------------------------------------
SetCursor Procedure
-----------------------------------------------------------
Purpose Sets the size of the cursor.
Declaration SetCursor ( StartLine, StopLine : Byte );
Remarks Sets the number of scan lines that are
displayed as the blinking cursor.
Monitor Scan lines
CGA 8 (0 - 7)
Mono 14 (0 - 13)
EGA 14 (0 - 13)
Scan lines are numbered from the top,
beginning at 0.
(from Programmer's Guide to the IBM PC
by Peter Norton, pg 174)
See also CursorOn, CursorOff
Example Create a block-sized cursor on a CGA.
SetCursor ( 0, 7 );
-----------------------------------------------------------
ShowDate Procedure
-----------------------------------------------------------
Purpose Displays the current date.
Decalration ShowDate ( Dx, Dy : Integer; Att : Byte );
Remarks Gets the date and displays it at (Dx,Dy) with
attribute Att.
Example Display the date.
ShowDate ( 1, 1, 112 );
{--- displays
Sat 27 Mar 88
at 1,1 in reverse video ---}
-----------------------------------------------------------
ShowTime Procedure
-----------------------------------------------------------
Purpose Displays the current time and date.
Decalration ShowTime ( Tx,Ty,Dx,Dy : Integer; Att : Byte );
Remarks Gets the time and displays it at (Tx,Ty) with
attribute Att. Displays the date at (Dx,Dy)
and refreshes it every midnight.
See also TimeXY, Stime
Example Keep a clock running until a keypress.
Repeat
ShowTime ( 64,1,1,1,112 );
Until Keypressed;
-----------------------------------------------------------
Space Function
-----------------------------------------------------------
Purpose Controls padding between words of a string.
Declaration Space ( S : String; N : Integer;
Pad : Char ) : String;
Result Type String
Remarks Returns a string with S modified as follows:
- leading and trailing blanks removed
- N copies of Pad inserted between each
word of S
If N = 1 and Pad is a blank, then Space
returns a normalized string. If N = 0,
then Space concatenates the words of S.
If S is null or a string of blanks, then
Space returns a null string.
See also Rword, Subword, WordN, Words, WordPos, WordInd
Example Normalize a string.
S := 'Lilburn, Georgia 30247';
S := Space(S,1,' ');
{--- assigns
'Lilburn, Georgia 30247'
to S ---}
-----------------------------------------------------------
SplitCloseH Procedure
-----------------------------------------------------------
Purpose Displays a screen by sliding it from the
sides to the center in a horizontal direction.
Declaration SplitCloseH ( FrontPage : HeapBuf;
Brake : Integer );
Remarks FrontPage is displayed as if it were two
sliding doors closing from the sides and
meeting at the middle. Brake controls the
speed of the closing.
See also SplitCloseV, SplitOpenH, SplitOpenV, Tile,
Hwipe, Vwipe
Example Restore a screen.
{--- Save the current screen ---}
SaveScreen ( Page[1] );
{--- Slide in a new screen ---}
SplitCloseH ( Page[2], 5 );
{--- Restore the original screen ---}
SplitOpenH ( Page[1], Page[2], 5 );
-----------------------------------------------------------
SplitCloseV Procedure
-----------------------------------------------------------
Purpose Displays a screen by sliding it from the
top and bottom to meet at the center.
Declaration SplitCloseV ( FrontPage : HeapBuf;
Brake : Integer );
Remarks FrontPage is displayed as if it were two
sliding doors closing from the top and
bottom to meet at the middle. Brake controls
the speed of the closing.
See also SplitCloseH, SplitOpenH, SplitOpenV, Tile,
Hwipe, Vwipe
Example Restore a screen.
{--- Save the current screen ---}
SaveScreen ( Page[1] );
{--- Slide in a new screen ---}
SplitCloseV ( Page[2], 5 );
{--- Restore the original screen ---}
SplitOpenV ( Page[1], Page[2], 5 );
-----------------------------------------------------------
SplitOpenH Procedure
-----------------------------------------------------------
Purpose Displays a screen by sliding back the current
screen from the center to the sides.
Declaration SplitOpenH ( BackPage, FrontPage : HeapBuf;
Brake : Integer );
Remarks BackPage is displayed by sliding FrontPage
from the center to the sides, as if two doors
were sliding open. Brake controls the speed
of the opening.
See also SplitCloseH, SplitCloseV, SplitOpenV, Tile,
Hwipe, Vwipe
Example Restore a screen.
{--- Save the current screen ---}
SaveScreen ( Page[1] );
{--- Slide in a new screen ---}
SplitCloseH ( Page[2], 5 );
{--- Restore the original screen ---}
SplitOpenH ( Page[1], Page[2], 5 );
-----------------------------------------------------------
SplitOpenV Procedure
-----------------------------------------------------------
Purpose Displays a screen by sliding back the current
screen from the center to the top and bottom.
Declaration SplitOpenV ( BackPage, FrontPage : HeapBuf;
Brake : Integer );
Remarks BackPage is displayed by sliding FrontPage
from the center to the top and bottom, as if
two doors were sliding open. Brake controls
the speed of the opening.
See also SplitCloseH, SplitCloseV, SplitOpenH, Tile,
Hwipe, Vwipe
Example Restore a screen.
{--- Save the current screen ---}
SaveScreen ( Page[1] );
{--- Slide in a new screen ---}
SplitCloseV ( Page[2], 5 );
{--- Restore the original screen ---}
SplitOpenV ( Page[1], Page[2], 5 );
-----------------------------------------------------------
Stime Procedure
-----------------------------------------------------------
Purpose Initializes the system time.
Declaration Stime ( HH, MM, SS : Integer );
Remarks Sets the clock to the hour (hh), minute (mm),
and seconds (ss) specified. Military time
format assumed. If the time is not valid, it
is not set.
See also TimeXY, ShowTime, SetTime (in DOS unit)
Example Set the system clock to 3:05:00 p.m.
Stime ( 15, 5, 0 );
-----------------------------------------------------------
Strip Function
-----------------------------------------------------------
Purpose Removes leading and trailing characters from
a string.
Declaration Strip ( S : String; Pad : Char ) : String;
Result Type String
Remarks Returns S with leading and trailing Pad
characters removed.
See also StripR
Example Remove underscores from an input field.
Field := 'Miami____';
Field := Strip(Field,'_');
{--- Field is now 'Miami' ---}
-----------------------------------------------------------
StripR Function
-----------------------------------------------------------
Purpose Removes leading, trailing or both leading
and trailing characters from a string.
Declaration Strip ( S : String; Option, Pad : Char )
: String;
Result Type String
Remarks Returns S with leading or trailing Pad
characters removed according to the
value of Option:
'L' - leading only
'T' - trailing only
'B' - both leading and trailing
Option is not case-sensitive; i.e., lower-
case characters may used as well.
See also Strip
Example Remove trailing characters from a string.
Field := '$5,200,188.00';
Field := StripR(StripR(Field,'T','0'),'T','.');
{--- Field is now
'$5,200,188' ---}
-----------------------------------------------------------
SubWord Function
-----------------------------------------------------------
Purpose Returns a substring of S.
Declaration SubWord ( S : String; N, NumWords : Integer )
: String;
Result Type String
Remarks Returns NumWords words of S, beginning with
word N. Returns a null string if S is null,
or all blanks, or if N is greater than the
number of words in S.
See also Rword, Space, WordInd, WordPos, WordN, Words
Example Extract a substring from a string.
S := 'This is the right stuff.';
S := SubWord(S,3,3);
{--- S is now 'the right stuff.' ---}
-----------------------------------------------------------
Tile Procedure
-----------------------------------------------------------
Purpose Copies a block from the heap to the screen
in a tiling pattern.
Declaration Tile ( Hpage : HeapBuf;
X1,Y1,X2,Y2,X3,Y3,Delay : Integer );
Remarks A special-effects routine that transfers
the block defined by (x1,y1), (x2,y2) on
Hpage to the screen beginning at (x3,y3).
Delay is a value used in an empty for-loop.
See also Hwipe, Vwipe, SplitCloseH, SplitOpenH,
SplitCloseV, SplitOpenV
Example Tile a block from page 1 of the heap.
Tile ( Page[1],
20, 5, 50, 10, 1, 1, 150 );
{--- The block at (20,5), (50,10) on
Page[1] is tiled to the area
beginning at (1,1) on the screen.
Uses a 150 delay ---}
-----------------------------------------------------------
Timer Function
-----------------------------------------------------------
Purpose Sets an elapsed time clock.
Declaration Timer ( Limit : Integer ) : Boolean;
Result Type Boolean
Remarks Returns TRUE if the number of seconds elapsed
since Time's invocation equals or exceeds
Limit. Otherwise, Timer returns FALSE.
Calls to Timer should not be nested.
In contrast to Turbo Pascal's Delay procedure,
Timer does not suspend program execution. It
simply keeps track of the time elapsed since
it was first called.
See also Wait
Example Contrast Timer and Delay.
{--- Loop for 3 seconds. This will
write 'Boosters' to the screen
over and over until 3 seconds
have elapsed ---}
Repeat
Writeln('Boosters');
Until Timer(3);
{--- Delay for 3 seconds. This will
write 'Boosters' once, wait 3
seconds, then exit the Repeat ---}
Repeat
WriteLn('Bosters');
Delay(3000);
Until 'a' = 'a';
-----------------------------------------------------------
TimeXY Procedure
-----------------------------------------------------------
Purpose Displays the system time at (x,y).
Declaration TimeXY ( X,Y : Integer; Att : Byte );
Remarks Gets the system time and displays it at
(x,y) with attribute Att. The cursor is
not affected.
See also ShowTime
Example Display the system time in reverse video.
TimeXY ( 66, 1, 112 );
-----------------------------------------------------------
Translate Function
-----------------------------------------------------------
Purpose Convert characters in a string by means of
a translate table.
Declaration Translate ( S, InTable, OutTable : String;
Pad : Char ) : String;
Result Type String
Remarks Characters of S are compared against the
contents of InTable. If a match occurs, the
element at the same position in OutTable is
copied to the return string. If a character
of S is not found in InTable, it is copied
to the return string unchanged.
When an element of S is found in InTable and
its position in InTable exceeds the length
of OutTable, Pad character is copied to the
return string.
If OutTable is null, every character in S
found in InTable is deleted from the return
string.
Examples Translate some strings.
s := 'include-file';
s := translate ( s, '-',' ',' ');
{--- S is now 'include file' ---}
S := translate ( 'aei', 'eia', '12', '$');
{--- S is set to $12 ---}
Null := '';
S := translate ( 'xlate','x',Null,' ');
{--- S is set to 'late' ---}
-----------------------------------------------------------
Upper Function
-----------------------------------------------------------
Purpose Converts alphabetics to uppercase.
Declaration Upper ( S : String ) : String;
Result Type String
Remarks Returns a string with the lowercase letters
of S converted to uppercase.
See also Lower
Example Convert a string to uppercase.
S := 'Location';
S := Upper(S);
{--- S is now 'LOCATION' ---}
-----------------------------------------------------------
Verify Function
-----------------------------------------------------------
Purpose Verifies that a string is composed only of
certain characters.
Declaration Verify ( S, Reference : String;
Start : Integer ) : Integer;
Result Type Integer
Remarks Verifies that S is composed only of
characters from Reference. If all
characters in S are members of Reference,
Verify returns a zero. Otherwise, Verify
returns the position of the first character
in S not found in Reference. The
verification begins at S[Start].
Example Verify a string.
s := Verify('01-01-80','0123456789/',1);
{--- Assigns 3 to s, since the '-' is
not a member of the reference set
---}
-----------------------------------------------------------
Vwipe Procedure
-----------------------------------------------------------
Purpose Copies a block to the screen using a
vertical wipe technique.
Declaration Vwipe ( Hpage : HeapBuf;
X1,Y1,X2,Y2,X3,Y3,Delay : Integer );
Remarks Writes a block from the heap to the screen
one row at a time, top-to-bottom, creating
a vertical wipe effect. Delay is the
terminating value of an empty for-loop
which is performed between row writes.
The block on the heap is defined by (x1,y1),
(x2,y2), while the screen destination is
given by (x3,y3).
See also Hwipe, Tile, SplitCloseH, SplitCloseV,
SplitOpenH, SplitOpenV
Example Wipe a block from the heap to the screen.
Vwipe ( Page[1],20,10,60,20,20,10,200 );
-----------------------------------------------------------
Wait Procedure
-----------------------------------------------------------
Purpose Delays execution for a specified time or
a specified keypress.
Declaration Wait ( NumberOfSeconds : integer;
Var C : Char );
Remarks Wait for NumberOfSeconds seconds to elapse
or a keypress, the value of which is
returned in C.
See also Timer
Example Control the displaying of screens.
Repeat
C := Escape;
Wait ( 5, C );
if C = #0 then C := readkey;
case C of
Home : RestoreScreen ( Page[1] );
End : RestoreScreen ( Page[2] );
end;
Until C = Escape;
-----------------------------------------------------------
WordInd Function
-----------------------------------------------------------
Purpose Returns the starting position of a word in
a string.
Declaration WordInd ( S : String; N : Integer ) : Integer;
Result Type Integer
Remarks Searches for the string position of word N
in S. Returns 0 if S is null or all blanks,
or if N is less than 1 or greater than the
number of words in S.
See also WordPos
Example Find the starting position of 'fox' below.
S := 'The quick brown fox';
start := WordInd ( S, 4);
{--- Since 'fox' is word 4, start is 17,
corresponding to the 'f' in fox ---}
-----------------------------------------------------------
WordN Function
-----------------------------------------------------------
Purpose Returns word N of S.
Declaration WordN ( S : String; N : Integer ) : String;
Result Type String
Remarks Returns a null string if S is null or all
blanks, or if N is less than 1 or greater
than the number of words in S.
See also SubWord
Example Extract the last word of any string.
S := WordN ( S, Words(S) );
-----------------------------------------------------------
WordPos Function
-----------------------------------------------------------
Purpose Returns the starting word position of
Needle in HayStack.
Declaration WordPos ( Needle, HayStack : String;
Start, IgnoreSpaces : Integer )
: Integer;
Result Type Integer;
Returns the starting word position of
Needle in HayStack. Start is the word
position within HayStack at which to
begin the search.
When IgnoreSpaces = 0, then extra spaces
between words are significant; when
IgnoreSpaces = 1, then extra spaces are
ignored.
See also Posr, LastPos, or Turbo Pascal's Pos
Example Find a starting word position of a string.
S := 'A b c';
P := WordPos ( Upper(S), 'A A B C',
1, 1);
{---
Above, WordPos will assign 2 to P
because needle begins at word 2 of
haystack. Note that differences in
spacing are ignored, as are
differencs in case by virtue of
Upper(S).
---}
-----------------------------------------------------------
Words Function
-----------------------------------------------------------
Purpose Returns the number of words in a string.
Declaration Words ( S : String; ) : Integer;
Result Type Integer
Remarks Returns a count of blank-delimiited words
in S.
Example List each word of a string in one column.
for i := 1 to words(S) do
WriteLn( WordN(S,i) );